You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This makes functions and types specified as internal not show up in the bindings. On top it also only exports the needed C std types and makes them opaque.
Before
After
The harfbuzz cc flag fixes an error that occurs on my machine when cross compiling to windows (the harfbuzz-sys crate also has this flag set).
It now also removes the va_list functions as all of them can be replaced by ... functions, and va_list seems to behave very differently between architectures and is not really usable in rust yet (this is all just from my understanding and probably wrong).
Sorry for only noticing this only after merging and looking at the main branch CI logs.
The windows build now prints warnings about u128 being not being FFI-safe. This is because fz_context.error.stack[0].buffer is of type jmp_buf which has an alignment of 16 on windows. To keep this alignment bindgen uses u128 inside the opaque type.
This warning is, however, is not releavant for us for many reasons:
we never pass a fz_context over FFI boundaries, only *mut fz_context
allow(improper_ctypes_definitions) in mupdf-sys. This would silence other improper_ctypes_definitions warning that might be useful though.
skip opaque-ing fz_context for now, hiding the types with this PR is more of a "style" and "correctness" thing, so removing it for now would be not a problem.
adding fz_context as our own opaque type not generated by bindgen. As we never need to create a fz_context on the rust side, but only have a pointer to it given to us by mupdf, we don't have to worry about it's alignment, and therefore don't have to fill it with u128 to achieve this. This sounds more confident than I am to have gotten the details right, but I think it makes sense.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes functions and types specified as internal not show up in the bindings. On top it also only exports the needed C std types and makes them opaque.
Before

After

The harfbuzz cc flag fixes an error that occurs on my machine when cross compiling to windows (the harfbuzz-sys crate also has this flag set).